{//加上该大括号之后, 就可以『避免』当前的变量与其他文件变量产生『冲突』
  //类  声明一个类之后, 会多出一个类型
  class Person{
    //属性
    name:string;
    age: number;
    test: number = 123;

    //方法
    //构造方法  构造方法的运行时 this 永远都指向 实例对象
    constructor(name: string, age: number){
      this.name = name;
      this.age = age;
    }

    //普通方法
    getName():string{
      return this.name;
    }
  }

  //实例化对象
  let me = new Person('xiaohigh', 36);
  let you:Person; // you 变量时一个 Person 类型的对象
  //实例化对象
  you = new Person('binfeng', 18);
  //完整写法
  let she:Person = new Person('xiaoyu', 18);

}


{
  class Person{
    //属性
    name:string;
    age: number;
    test: number = 123;

    //方法
    //构造方法  构造方法的运行时 this 永远都指向 实例对象
    constructor(name: string, age: number){
      this.name = name;
      this.age = age;
    }

    //普通方法
    getName():string{
      return this.name;
    }
  }

  class Boy extends Person{
    height: string;
    weight: string;

    constructor(name:string, age: number, height:string, weight: string){
      super(name, age);
      this.height = height;
      this.weight = weight;
    }

    play(){
      console.log('天生就爱玩~~');
    }
  }

  //实例化
  let me = new Boy('xiaohigh', 14, '170cm', '65kg');

  // console.log(me.getName());
  me.play();


}

{
  class Girl{
    //添加成员修饰符
    public name: string = '迪丽热巴';
    protected age: number = 25;
    private weight: string = '56KG';

    public a(){
      // console.log('aaa');
      console.log(this.name);
      console.log(this.age)
      console.log(this.weight);
    }

    protected b(){
      console.log('我可以约会...');
    }

    private c(){
      console.log('我可以kiss....');
    }
  }

  class TaoQiGirl extends Girl{
    test(){
      console.log(this.name);
      console.log(this.age);
      // console.log(this.weight);
    }
  }

  //实例化
  let taoGirl = new TaoQiGirl();


  //实例化对象
  // let dili = new Girl();

  //访问属性
  // console.log(dili.name);
  // console.log(dili.age); //属性“age”受保护，只能在类“Girl”及其子类中访问
  // console.log(dili.weight); //属性“weight”为私有属性，只能在类“Girl”中访问

  //调用
  // dili.a();
  // dili.b();
  // dili.c();
  

}